import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:furniture_demo/constants.dart';
import 'package:furniture_demo/screen/home/components/body.dart';
import 'package:furniture_demo/size_config.dart';

class HomeIndex extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    SizeConfig().init(context);
    return Scaffold(
      appBar: buildAppBar(),
      body: HomeBody(),
    );
  }

  AppBar buildAppBar() {
    return AppBar(
      leading: IconButton(
        onPressed: () {},
        icon: SvgPicture.asset('assets/icons/menu.svg',
            height: SizeConfig.defaultSize * 2),
      ),
      actions: [
        IconButton(
          onPressed: () {},
          icon: SvgPicture.asset('assets/icons/scan.svg',
              height: SizeConfig.defaultSize * 2.4),
        ),
        Center(
          child: Text(
            'scan',
            style: TextStyle(color: kTextColor, fontWeight: FontWeight.bold),
          ),
        ),
        SizedBox(width: SizeConfig.defaultSize),
      ],
    );
  }
}
